package com.zzh.ssm.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zzh.ssm.po.ItemsCustom;

/**
 * @author zhangzhenhua
 * @des  json交互测试
 * @date 2017年1月16日  上午12:24:54
 */
@Controller
public class jsonTest {
	
	//请求的是json(商品信息)输出的json(商品信息)
	//@RequestBody将请求商品信息的json串转成java对象
	//ResponseBody将返回的商品信息ItemsCustom转成json串输出
	@RequestMapping("/requestJson")
	 public @ResponseBody ItemsCustom requestJson(@RequestBody ItemsCustom itemsCustom){
		 System.out.println(itemsCustom);  
		return itemsCustom;
	 }
	
	@RequestMapping("/responsetJson")
	 public @ResponseBody ItemsCustom responsetJson(ItemsCustom itemsCustom){
		 System.out.println(itemsCustom);  
		return itemsCustom;
	 }

}
